# ORM外部配置
import datetime
import os
import random
import time



def orm_standby():
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "eCommerce.settings")  # manage.py文件中有同样的环境配置
    import django
    django.setup()


if __name__ == '__main__':
    orm_standby()
    from database import models


    find_obj = models.Total.objects.order_by("id")
    for obj in find_obj:
        if obj.wages >= 16000:

            res = float(str(obj.wages / 5)[0:2] + "00")
            print(res)
            models.Total.objects.filter(pk=obj.id).update(wages=res)









